<!-- START PAGE -->
<div id="page">
    <!-- start page title -->
    <div class="page-title">
        <div class="in">
            <div class="titlebar">  <h2><?php echo $template['title']?></h2>    
                <p>This is a quick overview of <?php echo $template['title']?></p>
            </div>                    
        </div>
    </div><!-- end page title -->
    

    <!-- START CONTENT -->
    <div class="content">
        <!-- start tabs codes -->
        <script type="text/javascript">
            $(function() {
                $( "#tabs" ).tabs();
            });
        </script>    
        <div class="grid740-left">
            <div id="tabs">                            
                <ul>
                    <li><a href="#tabs-1">Cấu hình site</a></li>
                    <li><a href="#tabs-2">Sản phẩm</a></li>
                    <li><a href="#tabs-3">Nội dung</a></li>
                </ul>
                <form id="form_add" name="form2" method="post" action="<?php echo $link_action?>" enctype="multipart/form-data">    
                <div id="tabs-1">
                    <div class="body">
                        <div class="st-form-line">
                            <span class="st-labeltext">Site name</span>
                            <input name="site_name" id="site_name" type="text" class="st-forminput" style="width:450px" value="<?=get_setting('site_name')?>" />
                            <div class="clear"></div>
                        </div>
                        <div class="st-form-line">
                            <span class="st-labeltext">Site title</span>
                            <input name="site_title" id="site_title" type="text" class="st-forminput" style="width:450px" value="<?=get_setting('site_title')?>" />
                            <div class="clear"></div>
                        </div>
                        <div class="st-form-line">
                            <span class="st-labeltext">Site description</span>
                            <textarea name="site_desc" class="st-forminput" id="site_desc" style="height:100px; width:450px;"><?=get_setting('site_desc')?></textarea>
                            <div class="clear"></div>
                        </div>
                        <div class="st-form-line">
                            <span class="st-labeltext">Điện thoại</span>
                            <input name="phone" id="phone" type="text" class="st-forminput" placeholder="0" style="width:100px" value="<?=get_setting('phone')?>" />
                            <div class="clear"></div>
                        </div>
                                    
                        <div class="st-form-line">
                            <span class="st-labeltext">Email</span>
                            <input name="email" id="email" type="text" class="st-forminput" placeholder="1" style="width:100px" value="<?=get_setting('email')?>" />
                            <div class="clear"></div>
                        </div>
                        <div class="st-form-line">
                            <span class="st-labeltext">Địa chỉ</span>
                            <input name="address" id="address" type="text" class="st-forminput" placeholder="1" style="width:450px" value="<?=get_setting('address')?>" />
                            <div class="clear"></div>
                        </div>
                        <div class="st-form-line">
                            <span class="st-labeltext">Google Analytic ID</span>
                            <input name="google_api" id="google_api" type="text" class="st-forminput" placeholder="1" style="width:450px" value="<?=get_setting('google_api')?>" />
                            <div class="clear"></div>
                        </div>
                        <div class="st-form-line">  <span class="st-labeltext">Trang thái site</span>
                            <select name="site_status" id="site_status">
                                <?php if(get_setting('site_status') == 1) : ?>
                                    <option value="1" selected="selected">Online</option>
                                <?php else : ?>
                                    <option value="1" selected="selected">Online</option>
                                <?php endif ?>
                                <?php if(get_setting('site_status') == 0) : ?>
                                    <option value="0" selected="selected">Offline</option>
                                <?php else : ?>
                                    <option value="0">Offline</option>
                                <?php endif ?>
                            </select>
                            <div class="clear"></div>
                        </div>
                    </div>    
                </div><!--End div#tabs-1 -->
                <div id="tabs-2">
                    <div class="st-form-line">
                        <span class="st-labeltext">Số bản tin hiển thị trên 1 trang</span>
                        <input name="per_page" id="per_page" type="text" class="st-forminput" placeholder="1" style="width:50px" value="<?=get_setting('per_page')?>" />
                        <div class="clear"></div>
                    </div>
                    <div class="st-form-line">
                        <span class="st-labeltext">Width thumb image product</span>
                        <input name="width_thumb" id="width_thumb" type="text" class="st-forminput" placeholder="1" style="width:50px" value="<?=get_setting('width_thumb')?>" />
                        <div class="clear"></div>
                    </div>
                    <div class="st-form-line">
                        <span class="st-labeltext">Height thumb image product</span>
                        <input name="height_thumb" id="height_thumb" type="text" class="st-forminput" placeholder="1" style="width:50px" value="<?=get_setting('height_thumb')?>" />
                        <div class="clear"></div>
                    </div>
                </div>
                <div id="tabs-3">
                    <div class="st-form-line">
                            <span class="st-labeltext">Hướng dẫn mua hàng</span>
                            <textarea name="guide_shopping" class="st-forminput" id="guide_shopping" style="height:250px; width:450px;"><?=get_setting('guide_shopping')?></textarea>
                            <div class="clear"></div>
                    </div>
                    <div class="st-form-line">
                            <span class="st-labeltext">Hướng dẫn đổi trả hàng</span>
                            <textarea name="guide_return" class="st-forminput" id="guide_return" style="height:250px; width:450px;"><?=get_setting('guide_return')?></textarea>
                            <div class="clear"></div>
                    </div>
                    <div class="st-form-line">
                            <span class="st-labeltext">Qui định người mua</span>
                            <textarea name="term" class="st-forminput" id="term" style="height:250px; width:450px;"><?=get_setting('term')?></textarea>
                            <div class="clear"></div>
                    </div>
                    <div class="st-form-line">
                            <span class="st-labeltext">Liên hệ</span>
                            <textarea name="contact" class="st-forminput" id="contact" style="height:250px; width:450px;"><?=get_setting('contact')?></textarea>
                            <div class="clear"></div>
                    </div>
                </div>      

                <div class="button-box" style="margin-top:20px;">
                    <input type="button" onclick="$('#form_add').submit()" name="button" id="button" value="Submit" class="st-button"/>
                </div>
                <input type="hidden" name="h_act" value="do_action">
                </form>
            </div><!--End tab-->                
        </div>
    </div><!-- END CONTENT -->
</div><!-- END PAGE -->
<div class="clear"></div>
<script type="text/javascript">
    jQuery(document).ready(function() {
        jQuery('#sidemenu ul li.active').removeClass('active');
        jQuery('#m_config').addClass('active');
    });
    
</script>
<script type="text/javascript">

    tinyMCE.init({
    // General options
    mode : "exact",
    elements : "guide_shopping, term, contact, guide_return",
    theme : "advanced",
    skin : "o2k7",
    relative_urls : false,
	convert_urls: false,
    plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",

    // Theme options
    theme_advanced_buttons1 : "bold,italic,underline,strikethrough,pastetext,pasteword,bullist,numlist,|,formatselect,fontselect,fontsizeselect, forecolor,backcolor,fullscreen",
    theme_advanced_buttons2 : "justifyleft,justifycenter,justifyright,justifyfull,fontselect,blockquote,|,undo,redo,|,link,unlink,image,media,|,code,preview",
    theme_advanced_buttons3 : "",
    theme_advanced_buttons4 : "",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_statusbar_location : "bottom",
    theme_advanced_resizing : true,
    file_browser_callback: "ajaxfilemanager",

    /* Example content CSS (should be your site CSS)
    content_css : "css/content.css",

    // Drop lists for link/image/media/template dialogs
    template_external_list_url : "lists/template_list.js",
    external_link_list_url : "lists/link_list.js",
    external_image_list_url : "lists/image_list.js",
    media_external_list_url : "lists/media_list.js",
    */
    // Replace values for the template plugin
    template_replace_values : {
        username : "Some User",
        staffid : "991234"
    }
    });

function ajaxfilemanager(field_name, url, type, win) {
    var ajaxfilemanagerurl = "<?=base_url();?>tinymce/jscripts/tiny_mce/plugins/ajaxfilemanager/ajaxfilemanager.php";
    switch (type) {
        case "image":
                break;
        case "media":
                break;
        case "flash":
                break;
        case "file":
                break;
        default:
            return false;
    }
    tinyMCE.activeEditor.windowManager.open({
        url: "<?=base_url();?>tinymce/jscripts/tiny_mce/plugins/ajaxfilemanager/ajaxfilemanager.php",
        width: 782,
        height: 400,
        inline : "yes",
        close_previous : "no"
    },{
        window : win,
        input : field_name
    });

}


</script>

